{extend name="base"/}

{block name="body"}
<!--tab标签-->
<div class="layui-field-box admin-main layui-form">
    <button class="layui-btn layui-btn-sm" onclick="window.history.go(-1);">返回</button>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>编辑课程</legend>
    </fieldset>

    <form class="layui-form"  data-url="{:url('admin/paid/type_update')}"  localtion-url="{:url('paid/video_type')}" >
        <div class="layui-form-item">
            <label class="layui-form-label"><text style="color:red;">* &nbsp;</text>父级</label>
            <div class="layui-input-inline">
                <select name="pid" id="" >
                    <option value="0">根目录</option>
                    {volist name="type" id="vo"}
                    {neq name="res.id" value="$vo.id"}
                    {if condition="$vo.pid eq 0"}
                    <option value="{$vo.id}" {eq name="res.pid" value="$vo.id"}selected{/eq}>{if condition="$vo.pid gt 0"}&nbsp;&nbsp;&nbsp;&nbsp;|--{/if}{$vo.typename}</option>
                    {/if}
                    {/neq}
                    {/volist}
                </select>
            </div>
        </div>
        <!--<div class="layui-form-item">-->
            <!--<label class="layui-form-label">分类代码</label>-->
            <!--<div class="layui-input-inline">-->
                <!--<input type="text" name="typecode" value="{$res.typecode}" required lay-verify="required" placeholder="请输入代码" class="layui-input">-->
            <!--</div>-->
        <!--</div>-->
        <div class="layui-form-item">
            <label class="layui-form-label"><text style="color:red;">* &nbsp;</text>名称</label>
            <div class="layui-input-inline">
                <input type="text" name="typename" value="{$res.typename}" required lay-verify="required" placeholder="（必填）请输入名称" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><text style="color:red;">* &nbsp;</text>排序</label>
            <div class="layui-input-inline">
                <input type="number" name="sort" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'0');" value="{$res.sort|default=0}" required lay-verify="required" placeholder="（必填）数字越大越靠后" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">数字越小排序越前(最小值为0)</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-inline">
                <input type="radio" name="status" value="1" title="开启" {eq name="res.status" value="1"} checked{/eq}>
                <input type="radio" name="status" value="0" title="关闭" {eq name="res.status" value="0"} checked{/eq}>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="formadd">立即提交</button>
                <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
            </div>
        </div>
        <input type="hidden" name="id" value="{$res.id}">
    </form>
</div>
{/block}

{block name="js"}
<script type="text/javascript" src="__PUBLIC__/js/formadd.js"></script>
{/block}